package com.example.demo1.test;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.stereotype.Component;

/**
 * @author sunjk
 * @since 2020/9/3
 */
@Component
public class Reveiver {

   /* @RabbitListener(queues = "hello")
    public void proce (String he) {
        System.out.println("消费者开始消费：" + he + "11111111");
    }*/

    @RabbitListener(queues = "hello.message")
    void proce1(String he, CorrelationData correlationData) {
        System.out.println("消费者开始消费hello.message：" + he + "11 correlationData:id=>>>" + correlationData.getId());
    }

    @RabbitListener(queues = "topic.hello.messages")
    void proce3(String he, CorrelationData correlationData) {
        String id = correlationData.getId();
        System.out.println("消费者开始消费topic.hello.messages：" + he + "22 correlationData:id=>>>" + id);
    }

}
